<template>
    <div>
        <iframe id="map_select" src="https://m.amap.com/picker/?key=dcfd7502637cd047272cda7f6bee4a40" height="400" width="700" ></iframe>
    </div>
</template>

<script>
export default {
    name:'MapSelect',
    mounted() {
         var iframe = document.getElementById('map_select').contentWindow;
        document.getElementById('map_select').onload = function(){
        iframe.postMessage('hello','https://m.amap.com/picker/');
        };
        window.addEventListener("message", function(e){
            console.log(e.data.name,e.data.location)
            // alert('您选择了:' + e.data.name + ',' + e.data.location)
        }, false);
    },

}
</script>